//
//  InputTemplateEightTableViewCell.m
//  CedarFinancePH
//
//  Created by menchao on 2018/8/9.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "InputTemplateEightTableViewCell.h"


@interface InputTemplateEightTableViewCell ()


@end

@implementation InputTemplateEightTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self!=nil){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.titleLbl];
        [self.contentView addSubview:self.subtitleLbl];
        [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView).mas_offset(kMarginOffsetX);
            make.top.mas_equalTo(self.contentView).mas_offset(12);
        }];
        [self.subtitleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleLbl);
            make.top.mas_equalTo(self.titleLbl.mas_bottom).mas_offset(6);
            make.right.mas_equalTo(self.contentView).mas_offset(-kMarginOffsetX);
        }];
        self.subtitleLbl.lineBreakMode =  NSLineBreakByWordWrapping;
        self.subtitleLbl.numberOfLines =  0;
    }
    return self;
}

+ (CGFloat)heightForCellWithText:(NSString *)text{
    if (IsEmptyStr(text)) {
        return 42;
    }
    CGFloat maxSize = SCREEN_WIDTH -  2*kMarginOffsetX;
    UIFont *font = PingFangZhongChangGuiForFont(14);
    CGSize size = [PlatformTools sizeWithString:text andFount:font andMaxSize:CGSizeMake(maxSize, MAXFLOAT)];
    return size.height + 53;
}

MACRO_UILabel_LazyloadWithPFCGFont(titleLbl, @"",kGrayColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(subtitleLbl, @"",kBlackColor, 14)

@end
